using System;
using System.Collections;

namespace RemoteController
{
	/// <summary>
	/// Summary description for MacroCommand
	/// </summary>
	public class MacroCommand : Command
	{
		Command[] commands;
		
		public MacroCommand(Command[] commands) {
			this.commands = commands;
        }

        #region Command Members
        public object Execute() {
			
            ArrayList ex_comm = new ArrayList();
			for (int i = 0; i < commands.Length; i++) {
				ex_comm.Add(commands[i].Execute());
			}
			return ex_comm;
		}
	 
		public object Undo() {
			ArrayList un_comm = new ArrayList();
			for (int i = 0; i < commands.Length; i++) 
            {
                un_comm.Add(commands[i].Undo());
			}
			return un_comm;
        }
        #endregion
    }
}